#pragma once

#include <utility>
#if (_MSC_VER == 1700)
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
#include <set>

#define MAX_SHIP 5

typedef std::pair<int,int> Point;
typedef std::set<Point> PointSet;

class Ship {
public:
	enum TypeOfShip {DESTROYER, PATROL, SUBMARINE, BATTLE, AIRCRAFT};
	enum Rotation {HORIZONTAL,VERTICAL};
private:
	PointSet m_pos;
	TypeOfShip m_type;
	int m_count;
public:
	Ship(TypeOfShip type, int x, int y, Rotation rotation);
	~Ship();
	PointSet GetSpaceForShip();
	PointSet GetPos();
	TypeOfShip GetType();
	static int GetLength(Ship::TypeOfShip _type);
	bool Shot(Point p);
	bool IsDestroyed();
};

#if (_MSC_VER == 1700)
typedef std::shared_ptr<Ship> ShipPtr;
#else
typedef boost::shared_ptr<Ship> ShipPtr;
#endif
